package src.main.java.org.string;

public class StringDemo1 {
    public static void main(String[] args) {
        //1.直接双引号得到字符串对象，并调用构造器初始化字符串
        String name = "hello";
        System.out.println(name);

        //2.new String创建字符串对象，并调用构造器初始化字符串
        String rs1 = new String();
        System.out.println(rs1);

        String itheima = new String("itheima");
        System.out.println(itheima);

        char[] chars = {'a','雷'};
        String rs3 = new String(chars);
        System.out.println(rs3);

        byte[] bytes = {97,98,99};
        String rs4 = new String(bytes);
        System.out.println(rs4);
    }
}
